package com.rock.code.bigdata.bigdatainterface.service.impl;


import com.rock.code.bigdata.bigdatainterface.dao.CreateTabDao;
import com.rock.code.bigdata.bigdatainterface.service.CreateTabService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
public class CreateTabServiceImpl implements CreateTabService {

    @Resource
    private CreateTabDao createTabDao;

    @Override
    public void createTabHis(String tableName) {
        createTabDao.createHisTab(tableName);
    }

    @Override
    public boolean isExists(String tableName) {
        if (createTabDao.isExitsByTabname(tableName) == "0" || "0".equals(createTabDao.isExitsByTabname(tableName))) {
            return true;
        }
        return false;
    }

    @Override
    public void createWeekTab(String tableName) {
        createTabDao.createWeekTab(tableName);
    }

    @Override
    public void createYearTab(String tableName) {
        createTabDao.createHisTab(tableName);
    }
}
